New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Review and clean up all Box-Cox functions #3080
Conversation
Returns | ||
------- | ||
llf : float | ||
Box-Cox log-likelihood of `data` given `lmbda`. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Should say "given lmb
."
This is great, Ralf! I made a few comments inline. I think the I noticed a bug in
|
I think the core Box-Cox function,
should be implemented as a ufunc, and perhaps added to scipy.special. This would eliminate some of the spurious Runtime Warnings generated when a value is zero, and it could be reused in |
I created a pull request that implements the core Box-Cox transformation as a ufunc in scipy.special: #3150 |
lmbda = lmbda*(x == x) | ||
y = where(lmbda == 0, log(x), (x**lmbda - 1)/lmbda) | ||
lmbda = lmbda * (x == x) # equal to ``lmbda * np.ones(x.shape)`` | ||
y = np.where(lmbda == 0, log(x), (x**lmbda - 1) / lmbda) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
#3150 was merged, so this line and the previous can be replaced by y = special.boxcox(x, lmbda)
.
…guide. Also do a PEP8 cleanup of `boxcox`.
…ndling. Add also a reference to the original paper of Box and Cox.
Also some PEP8 cleanups in related functions.
boxcox() doesn't accept 2-D input, leave it like that.
Also refactor boxcox and boxcox_normmax so MLE can be used from the latter. Changes the `brack` keyword in boxcox_normmax; it differed from that used in boxcox(), keeping boxcox() results unchanged is preferred here. This finishes the Statistics Review for all Box-Cox functions: Closes scipygh-680 Closes scipygh-681 Closes scipygh-682 Closes scipygh-683 Closes scipygh-684
Re |
Thanks for the review Warren. Addressed all your comments in the last commit. |
"""Compute parameters for a Box-Cox normality plot, optionally show it. | ||
|
||
A Box-Cox normality plot shows graphically what the best transformation | ||
parameter is to use in `boxcox` for obtained a distribution that is close |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
"... to obtain a distribution ..." or perhaps "... for obtaining a distribution ..."
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
Addresses review comment on scipygh-3080. [ci skip]
Did the Travis tests run? I don't see the usual Travis status bar. |
Yes they did for the second to last commit. The last commit is a one line change to a docstring, so I added |
OK, I see that now (and I just noticed the little green check mark next to the penultimate commit). Merging. |
Review and clean up all Box-Cox functions
No description provided.